package editor.windows;

import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.StringTokenizer;

import javax.swing.JOptionPane;
import javax.swing.text.MaskFormatter;

import adventure.placeable.ItemEdit;
import adventure.placeable.ItemUnlocks;
import adventure.placeable.ItemUnlocksImp;
import adventure.placeable.PlaceableManager;
import adventure.placeable.PlaceableManagerEdit;

/**
 *
 * @author Michael Hanns
 *
 */
public class EditorItemView extends javax.swing.JDialog {

    private static final long serialVersionUID = -1522782237246166517L;
    private PlaceableManager placeables;
    private int totalItems;
    private WITNAFrameView parent;

    /**
     * Creates new form EditorItemView
     */
    public EditorItemView(java.awt.Frame parent, PlaceableManager p) {
        super(parent, true);
        this.parent = (WITNAFrameView) parent;
        placeables = p;
        initComponents();
        if (placeables.getItem(1).getID() == 0) {
            ((PlaceableManagerEdit) placeables).newItem();
        }
        fillTable();
        getItemData(totalItems - 1);
    }

    public void fillTable() {
        itemListTable.removeAll();

        int x = 1;
        while (placeables.getItem(x).getID() != 0) {
            itemListTable.getModel().setValueAt(placeables.getItem(x).getID(), x - 1, 0);
            itemListTable.getModel().setValueAt(placeables.getItem(x).getName(), x - 1, 1);
            x++;
        }

        totalItems = x;

        itemListTable.changeSelection(x - 1, 2, false, false);
    }

    public void getItemData(int row) {
        if (row > 0) {
            unlocksCombo.removeAllItems();

            ItemEdit item = (ItemEdit) placeables.getItem(row);

            idBox.setText("" + item.getID());
            nameBox.setText(item.getName());
            descriptionBox.setText(item.getDescription());
            typeBox.setSelectedItem(item.getItemType());
            typeModBox.setText("" + item.getModifier());
            currencyValueBox.setText("" + item.getCurrencyValue());

            if (!item.isConsumable()) {
                consumableBox.setSelected(false);
                totalUsesBox.setEnabled(false);
                totalUsesBox.setText("");
            } else {
                consumableBox.setSelected(true);
                totalUsesBox.setEnabled(true);
                totalUsesBox.setText("" + item.getTotalUses());
            }

            if (!item.isTemporary()) {
                temporaryBox.setSelected(false);
                ticksRemainBox.setEnabled(false);
                ticksRemainBox.setText("");
            } else {
                temporaryBox.setSelected(true);
                ticksRemainBox.setEnabled(true);
                ticksRemainBox.setText("" + item.getTicksRemaining());
            }

            visibleBox.setSelected(item.isVisible());

            boundBox.setSelected(item.isBound());

            lightSourceBox.setSelected(item.isLightSource());

            ArrayList<ItemUnlocks> unlocks = item.getUnlocks();
            for (int x = 0; x < unlocks.size(); x++) {
                unlocksCombo.addItem(unlocks.get(x).getStringRepresentation());
            }

        }
    }

    private void addItemUnlocks() {
        if (unlocksXBox.getText().length() > 0 && unlocksYBox.getText().length() > 0
                && unlocksZBox.getText().length() > 0) {

            int x = Integer.parseInt(unlocksXBox.getText());
            int y = Integer.parseInt(unlocksYBox.getText());
            int z = Integer.parseInt(unlocksZBox.getText());
            String dirText = unlocksDirBox.getText();
            char dir;
            if (dirText.length() > 0) {
                dir = dirText.charAt(0);
            } else {
                dir = 'X';
            }

            if (dir == 'N' || dir == 'E' || dir == 'S' || dir == 'W'
                    || dir == 'U' || dir == 'D') {

                unlocksCombo.addItem("(" + x + ", " + y + ", " + z + ")" + " : " + dir);

                unlocksXBox.setText("");
                unlocksYBox.setText("");
                unlocksZBox.setText("");
                unlocksDirBox.setText("");
            } else {
                JOptionPane.showMessageDialog(this, "You must enter N, E, S, W, U or D into the direction box!");
            }
        } else {
            JOptionPane.showMessageDialog(this, "You must enter the coordinates of the target room in the x/y/z fields first.");
        }
    }

    private void addNewItem() {
        if (totalItems <= 200) {
            if (placeables.getItem(totalItems - 1).getName().trim().length() == 0) {
                parent.printToConsole("You must specify a name for all existing items before creating a new one!");
            } else {
                ((PlaceableManagerEdit) placeables).newItem();
                fillTable();
                getItemData(totalItems - 1);
            }
        } else {
            parent.printToConsole("You have reached the maximum number of items!");
        }
    }

    private void duplicateItem(int id) {
        if (totalItems <= 200) {
            if (placeables.getItem(totalItems - 1).getName().trim().length() == 0) {
                parent.printToConsole("You must specify a name for all existing items before duplicating one!");
            } else {
                if (id > 0) {
                    if (placeables.getItem(id).getID() != 0) {
                        ItemEdit newItem = (ItemEdit) placeables.getItem(id).cloneThis();
                        newItem.setID(totalItems);
                        ((PlaceableManagerEdit) placeables).newItem(newItem);
                        fillTable();
                        getItemData(totalItems - 1);
                    } else {
                        parent.printToConsole("You must select an existing item before attempting to duplicate!");
                    }
                }
            }
        } else {
            parent.printToConsole("You have reached the maximum number of items!");
        }
    }

    private void applyChanges(int id, String name) {
        if (id > 0 && name.length() > 0) {

            if (placeables.getItem(id).getID() > 0) {

                String description = descriptionBox.getText();
                String type = typeBox.getSelectedItem().toString();

                int typeMod = 0;
                if (typeModBox.isEnabled()) {
                    typeMod = Integer.parseInt(typeModBox.getText());
                }

                int value = 0;
                if (currencyValueBox.isEnabled()) {
                    value = Integer.parseInt(currencyValueBox.getText());
                }

                boolean consumable = consumableBox.isSelected();
                int totalUses = 0;
                if (totalUsesBox.isEnabled()) {
                    totalUses = Integer.parseInt(totalUsesBox.getText());
                }

                boolean temporary = temporaryBox.isSelected();
                int ticksRemain = 0;
                if (ticksRemainBox.isEnabled()) {
                    ticksRemain = Integer.parseInt(ticksRemainBox.getText());
                }

                boolean lightSource = lightSourceBox.isSelected();

                boolean visible = visibleBox.isSelected();

                boolean bound = boundBox.isSelected();


                ArrayList<ItemUnlocks> unlocks = new ArrayList<ItemUnlocks>();

                // If item has unlocking properties, add this..
                if (unlocksCombo.getItemCount() != 0) {
                    // For every item in the unlocks combo..
                    for (int n = 0; n < unlocksCombo.getItemCount(); n++) {
                        // Parse the string data into ItemUnlocks objects.
                        String dataString = unlocksCombo.getItemAt(n).toString();
                        System.out.println(dataString);
                        dataString = dataString.replace("(", "").replace(")", "").replace(":", " ").replace(",", " ");
                        System.out.println(dataString);
                        StringTokenizer tokens = new StringTokenizer(dataString);


                        int x = Integer.parseInt(tokens.nextToken());
                        int y = Integer.parseInt(tokens.nextToken());
                        int z = Integer.parseInt(tokens.nextToken());
                        char dir = tokens.nextToken().charAt(0);
                        ItemUnlocks unlock = new ItemUnlocksImp(x, y, z, dir);
                        unlocks.add(unlock);
                    }
                }
                ((PlaceableManagerEdit) placeables).editItem(id, "NAME", name);
                ((PlaceableManagerEdit) placeables).editItem(id, "DESCRIPTION", description);
                ((PlaceableManagerEdit) placeables).editItem(id, "TYPE", type);
                ((PlaceableManagerEdit) placeables).editItem(id, "MODIFIER", typeMod);
                ((PlaceableManagerEdit) placeables).editItem(id, "CURRENCYVALUE", value);
                ((PlaceableManagerEdit) placeables).editItem(id, "CONSUMABLE", consumable);
                ((PlaceableManagerEdit) placeables).editItem(id, "TOTALUSES", totalUses);
                ((PlaceableManagerEdit) placeables).editItem(id, "TEMPORARY", temporary);
                ((PlaceableManagerEdit) placeables).editItem(id, "TICKSREMAIN", ticksRemain);
                ((PlaceableManagerEdit) placeables).editItem(id, "VISIBLE", visible);
                ((PlaceableManagerEdit) placeables).editItem(id, "LIGHTSOURCE", lightSource);
                ((PlaceableManagerEdit) placeables).editItem(id, "BOUND", bound);
                ((PlaceableManagerEdit) placeables).removeItemUnlocksProperties(id);

                for (int x = 0; x < unlocks.size(); x++) {
                    ((PlaceableManagerEdit) placeables).addItemUnlocksProperty(id, unlocks.get(x));
                }

                fillTable();
                parent.setUnsavedChanges(true);

                parent.printToConsole("Item " + name + " updated.");
                getItemData(id);
            } else {
                parent.printToConsole("You must select an existing item before applying changes!");
            }
        } else {
            parent.printToConsole("WARNING: Item changes not saved. You must specify a name for the item!");
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane2 = new javax.swing.JScrollPane();
        jList1 = new javax.swing.JList();
        itemListPane = new javax.swing.JScrollPane();
        itemListTable = new javax.swing.JTable();
        nameBox = new javax.swing.JFormattedTextField();
        idBox = new javax.swing.JFormattedTextField(NumberFormat.getInstance());
        jScrollPane1 = new javax.swing.JScrollPane();
        descriptionBox = new javax.swing.JTextPane();
        typeBox = new javax.swing.JComboBox();
        idLabel = new javax.swing.JLabel();
        nameLabel = new javax.swing.JLabel();
        descriptionLabel = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        closeButton = new javax.swing.JButton();
        newItemButton = new javax.swing.JButton();
        applyButton = new javax.swing.JButton();
        typeLabel = new javax.swing.JLabel();
        duplicateButton = new javax.swing.JButton();
        unlocksPanel = new javax.swing.JPanel();
        unlocksZBox = new javax.swing.JFormattedTextField(NumberFormat.getInstance());
        MaskFormatter formatter = null;

        try {
            formatter = new MaskFormatter("U");
        } catch (Exception e) {
            e.printStackTrace();
        }

        if(formatter != null) {
            unlocksDirBox = new javax.swing.JFormattedTextField(formatter);
            unlocksXBox = new javax.swing.JFormattedTextField(NumberFormat.getInstance());
            unlocksYBox = new javax.swing.JFormattedTextField(NumberFormat.getInstance());
            unlocksCombo = new javax.swing.JComboBox();
            unlocksAddButton = new javax.swing.JButton();
            unlocksRemoveButton = new javax.swing.JButton();
            unlocksYLabel = new javax.swing.JLabel();
            unlocksXLabel = new javax.swing.JLabel();
            unlocksZLabel = new javax.swing.JLabel();
            unlocksDirLabel = new javax.swing.JLabel();
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            jLabel4 = new javax.swing.JLabel();
            totalUsesLabel = new javax.swing.JLabel();
            totalUsesBox = new javax.swing.JFormattedTextField(NumberFormat.getInstance());
            typeModLabel = new javax.swing.JLabel();
            typeModBox = new javax.swing.JFormattedTextField(NumberFormat.getInstance());
            consumableBox = new javax.swing.JCheckBox();
            lightSourceBox = new javax.swing.JCheckBox();
            visibleBox = new javax.swing.JCheckBox();
            ticksRemainBox = new javax.swing.JFormattedTextField(NumberFormat.getInstance());
            ticksRemainLabel = new javax.swing.JLabel();
            temporaryBox = new javax.swing.JCheckBox();
            currencyValueLabel = new javax.swing.JLabel();
            currencyValueBox = new javax.swing.JFormattedTextField(NumberFormat.getInstance());
            boundBox = new javax.swing.JCheckBox();

            jList1.setModel(new javax.swing.AbstractListModel() {
                String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
                public int getSize() { return strings.length; }
                public Object getElementAt(int i) { return strings[i]; }
            });
            jScrollPane2.setViewportView(jList1);

            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setTitle("Edit Items");
            setAlwaysOnTop(true);
            setLocationByPlatform(true);
            setResizable(false);

            itemListTable.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null},
                    {null, null}
                },
                new String [] {
                    "#", "Name"
                }
            ) {
                Class[] types = new Class [] {
                    java.lang.String.class, java.lang.String.class
                };
                boolean[] canEdit = new boolean [] {
                    false, false
                };

                public Class getColumnClass(int columnIndex) {
                    return types [columnIndex];
                }

                public boolean isCellEditable(int rowIndex, int columnIndex) {
                    return canEdit [columnIndex];
                }
            });
            itemListTable.setToolTipText("Item list");
            itemListTable.setColumnSelectionAllowed(true);
            itemListTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
            itemListTable.addMouseListener(new java.awt.event.MouseAdapter() {
                public void mouseClicked(java.awt.event.MouseEvent evt) {
                    itemListTableMouseClicked(evt);
                }
            });
            itemListPane.setViewportView(itemListTable);
            itemListTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
            itemListTable.getColumnModel().getColumn(0).setMinWidth(10);
            itemListTable.getColumnModel().getColumn(0).setPreferredWidth(25);
            itemListTable.getColumnModel().getColumn(0).setMaxWidth(25);

            nameBox.setToolTipText("Item name");

            idBox.setEditable(false);
            idBox.setToolTipText("Item number");

            descriptionBox.setToolTipText("Item description");
            jScrollPane1.setViewportView(descriptionBox);

            typeBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "MISC", "WEAPON", "OFFHAND", "HEAD", "CHEST", "FEET", "HPOTION", "SPOTION", "FOOD" }));
            typeBox.setToolTipText("Item type");
            typeBox.addItemListener(new java.awt.event.ItemListener() {
                public void itemStateChanged(java.awt.event.ItemEvent evt) {
                    typeBoxItemStateChanged(evt);
                }
            });

            idLabel.setText("ID:");

            nameLabel.setText("Name:");

            descriptionLabel.setText("Description:");

            closeButton.setText("Close");
            closeButton.setMaximumSize(new java.awt.Dimension(70, 25));
            closeButton.setMinimumSize(new java.awt.Dimension(70, 25));
            closeButton.setPreferredSize(new java.awt.Dimension(70, 25));
            closeButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    closeButtonActionPerformed(evt);
                }
            });

            newItemButton.setText("Add new..");
            newItemButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    newItemButtonActionPerformed(evt);
                }
            });

            applyButton.setText("Apply");
            applyButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    applyButtonActionPerformed(evt);
                }
            });

            typeLabel.setText("Item Type:");

            duplicateButton.setText("Duplicate");
            duplicateButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    duplicateButtonActionPerformed(evt);
                }
            });

            unlocksPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Item Unlocks:"));

            unlocksZBox.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
            unlocksZBox.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("###0"))));
            unlocksZBox.setToolTipText("Unlocks at Z");
            unlocksZBox.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    unlocksZBoxActionPerformed(evt);
                }
            });

        } else {
            unlocksDirBox = new javax.swing.JFormattedTextField();
        }
        unlocksDirBox.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        unlocksDirBox.setColumns(1);
        unlocksDirBox.setToolTipText("Unlocks direction");

        unlocksXBox.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        unlocksXBox.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("###0"))));
        unlocksXBox.setToolTipText("Unlocks at X");

        unlocksYBox.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        unlocksYBox.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("###0"))));
        unlocksYBox.setToolTipText("Unlocks at Y");

        unlocksCombo.setToolTipText("Doors item unlocks");

        unlocksAddButton.setText("Add");
        unlocksAddButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                unlocksAddButtonActionPerformed(evt);
            }
        });

        unlocksRemoveButton.setText("Remove");
        unlocksRemoveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                unlocksRemoveButtonActionPerformed(evt);
            }
        });

        unlocksYLabel.setText("Y:");

        unlocksXLabel.setText("X:");

        unlocksZLabel.setText("Z:");

        unlocksDirLabel.setText("Dir:");

        jLabel1.setFont(new java.awt.Font("Lucida Grande", 0, 16)); // NOI18N
        jLabel1.setText("(");

        jLabel2.setFont(new java.awt.Font("Lucida Grande", 0, 16)); // NOI18N
        jLabel2.setText(",");

        jLabel3.setFont(new java.awt.Font("Lucida Grande", 0, 16)); // NOI18N
        jLabel3.setText(",");

        jLabel4.setFont(new java.awt.Font("Lucida Grande", 0, 16)); // NOI18N
        jLabel4.setText(") : ");

        javax.swing.GroupLayout unlocksPanelLayout = new javax.swing.GroupLayout(unlocksPanel);
        unlocksPanel.setLayout(unlocksPanelLayout);
        unlocksPanelLayout.setHorizontalGroup(
            unlocksPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(unlocksPanelLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(unlocksPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(unlocksPanelLayout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(4, 4, 4)
                        .addGroup(unlocksPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(unlocksPanelLayout.createSequentialGroup()
                                .addComponent(unlocksXLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(21, 21, 21)
                                .addComponent(unlocksYLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(unlocksPanelLayout.createSequentialGroup()
                                .addComponent(unlocksXBox, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(unlocksYBox, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(unlocksPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(unlocksZLabel)
                            .addComponent(unlocksZBox, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel4)
                        .addGap(10, 10, 10)
                        .addGroup(unlocksPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(unlocksDirLabel)
                            .addComponent(unlocksDirBox, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(unlocksCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(unlocksPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(unlocksRemoveButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(unlocksAddButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(2, 2, 2))
        );
        unlocksPanelLayout.setVerticalGroup(
            unlocksPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, unlocksPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(unlocksPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(unlocksXLabel)
                    .addComponent(unlocksYLabel)
                    .addComponent(unlocksZLabel)
                    .addComponent(unlocksDirLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(unlocksPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(unlocksXBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(unlocksYBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(unlocksZBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(unlocksAddButton)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3)
                    .addComponent(jLabel4)
                    .addComponent(unlocksDirBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 13, Short.MAX_VALUE)
                .addGroup(unlocksPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(unlocksCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(unlocksRemoveButton))
                .addGap(6, 6, 6))
        );

        totalUsesLabel.setText("Total Uses:");

        totalUsesBox.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("###0"))));
        totalUsesBox.setEnabled(false);

        typeModLabel.setText("Type Modifier: ");

        typeModBox.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("###0"))));

        consumableBox.setText("Consumable");
        consumableBox.setToolTipText("Item consumable (y/n)");
        consumableBox.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                consumableBoxStateChanged(evt);
            }
        });
        consumableBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                consumableBoxActionPerformed(evt);
            }
        });

        lightSourceBox.setText("Light Source");

        visibleBox.setText("Visible");
        visibleBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                visibleBoxActionPerformed(evt);
            }
        });

        ticksRemainBox.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("###0"))));
        ticksRemainBox.setEnabled(false);

        ticksRemainLabel.setText("Ticks Remain:");

        temporaryBox.setText("Temporary");
        temporaryBox.setToolTipText("Item consumable (y/n)");
        temporaryBox.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                temporaryBoxStateChanged(evt);
            }
        });
        temporaryBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                temporaryBoxActionPerformed(evt);
            }
        });

        currencyValueLabel.setText("Currency Value:");

        currencyValueBox.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("###0"))));

        boundBox.setText("Bound");
        boundBox.setToolTipText("Item consumable (y/n)");
        boundBox.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                boundBoxStateChanged(evt);
            }
        });
        boundBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boundBoxActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(itemListPane, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(idLabel)
                            .addComponent(idBox, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(8, 8, 8)
                                .addComponent(nameLabel))
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(nameBox))))
                    .addComponent(jScrollPane1)
                    .addComponent(jSeparator1)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(newItemButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(duplicateButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(closeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(applyButton, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(typeBox, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(typeLabel))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(ticksRemainLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(typeModLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(currencyValueLabel)
                            .addComponent(totalUsesLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(10, 10, 10)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(0, 0, Short.MAX_VALUE)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(totalUsesBox, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(typeModBox, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ticksRemainBox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(20, 20, 20))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(currencyValueBox, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(temporaryBox)
                            .addComponent(lightSourceBox)
                            .addComponent(visibleBox)
                            .addComponent(consumableBox)
                            .addComponent(boundBox)))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(descriptionLabel)
                            .addComponent(unlocksPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(idLabel)
                            .addComponent(nameLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(nameBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(idBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(descriptionLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(5, 5, 5)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(typeLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(typeBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(92, 92, 92)
                                .addComponent(unlocksPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(newItemButton)
                                    .addComponent(applyButton)
                                    .addComponent(closeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(duplicateButton)))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(typeModBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(typeModLabel))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(totalUsesBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(totalUsesLabel))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(ticksRemainBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(ticksRemainLabel))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(currencyValueLabel)
                                            .addComponent(currencyValueBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(lightSourceBox)
                                        .addGap(0, 0, 0)
                                        .addComponent(visibleBox)
                                        .addGap(0, 0, 0)
                                        .addComponent(consumableBox)
                                        .addGap(0, 0, 0)
                                        .addComponent(temporaryBox)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(boundBox)))
                                .addGap(0, 0, Short.MAX_VALUE))))
                    .addComponent(itemListPane, javax.swing.GroupLayout.DEFAULT_SIZE, 528, Short.MAX_VALUE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void typeBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_typeBoxItemStateChanged
    }//GEN-LAST:event_typeBoxItemStateChanged

    private void itemListTableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_itemListTableMouseClicked
        int row = itemListTable.getSelectedRow();

        if (itemListTable.getModel().getValueAt(row, 0) != null) {
            int id = Integer.parseInt(itemListTable.getModel().getValueAt(row, 0).toString());
            getItemData(id);
        }
    }//GEN-LAST:event_itemListTableMouseClicked

    private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed
        dispose();
    }//GEN-LAST:event_closeButtonActionPerformed

    private void newItemButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newItemButtonActionPerformed
        addNewItem();
    }//GEN-LAST:event_newItemButtonActionPerformed

    private void applyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_applyButtonActionPerformed
        int id = Integer.parseInt(idBox.getText());
        String name = nameBox.getText();

        applyChanges(id, name);
    }//GEN-LAST:event_applyButtonActionPerformed

    private void duplicateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_duplicateButtonActionPerformed
        int id = Integer.parseInt(idBox.getText());

        duplicateItem(id);
    }//GEN-LAST:event_duplicateButtonActionPerformed

    private void unlocksZBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_unlocksZBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_unlocksZBoxActionPerformed

    private void unlocksAddButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_unlocksAddButtonActionPerformed
        addItemUnlocks();
    }//GEN-LAST:event_unlocksAddButtonActionPerformed

    private void unlocksRemoveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_unlocksRemoveButtonActionPerformed
        if (unlocksCombo.getSelectedIndex() > -1) {
            unlocksCombo.removeItemAt(unlocksCombo.getSelectedIndex());
        }
    }//GEN-LAST:event_unlocksRemoveButtonActionPerformed

    private void consumableBoxStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_consumableBoxStateChanged
    }//GEN-LAST:event_consumableBoxStateChanged

    private void consumableBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_consumableBoxActionPerformed
        if (consumableBox.isSelected()) {
            totalUsesBox.setEnabled(true);
            totalUsesBox.setText("0");
        } else {
            totalUsesBox.setEnabled(false);
            totalUsesBox.setText("");
        }
    }//GEN-LAST:event_consumableBoxActionPerformed

    private void visibleBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_visibleBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_visibleBoxActionPerformed

    private void temporaryBoxStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_temporaryBoxStateChanged
    }//GEN-LAST:event_temporaryBoxStateChanged

    private void temporaryBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_temporaryBoxActionPerformed
        if (temporaryBox.isSelected()) {
            ticksRemainBox.setEnabled(true);
            ticksRemainBox.setText("0");
        } else {
            ticksRemainBox.setEnabled(false);
            ticksRemainBox.setText("");
        }
    }//GEN-LAST:event_temporaryBoxActionPerformed

    private void boundBoxStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_boundBoxStateChanged
        // TODO add your handling code here:
    }//GEN-LAST:event_boundBoxStateChanged

    private void boundBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boundBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_boundBoxActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton applyButton;
    private javax.swing.JCheckBox boundBox;
    private javax.swing.JButton closeButton;
    private javax.swing.JCheckBox consumableBox;
    private javax.swing.JFormattedTextField currencyValueBox;
    private javax.swing.JLabel currencyValueLabel;
    private javax.swing.JTextPane descriptionBox;
    private javax.swing.JLabel descriptionLabel;
    private javax.swing.JButton duplicateButton;
    private javax.swing.JFormattedTextField idBox;
    private javax.swing.JLabel idLabel;
    private javax.swing.JScrollPane itemListPane;
    private javax.swing.JTable itemListTable;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JList jList1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JCheckBox lightSourceBox;
    private javax.swing.JFormattedTextField nameBox;
    private javax.swing.JLabel nameLabel;
    private javax.swing.JButton newItemButton;
    private javax.swing.JCheckBox temporaryBox;
    private javax.swing.JFormattedTextField ticksRemainBox;
    private javax.swing.JLabel ticksRemainLabel;
    private javax.swing.JFormattedTextField totalUsesBox;
    private javax.swing.JLabel totalUsesLabel;
    private javax.swing.JComboBox typeBox;
    private javax.swing.JLabel typeLabel;
    private javax.swing.JFormattedTextField typeModBox;
    private javax.swing.JLabel typeModLabel;
    private javax.swing.JButton unlocksAddButton;
    private javax.swing.JComboBox unlocksCombo;
    private javax.swing.JFormattedTextField unlocksDirBox;
    private javax.swing.JLabel unlocksDirLabel;
    private javax.swing.JPanel unlocksPanel;
    private javax.swing.JButton unlocksRemoveButton;
    private javax.swing.JFormattedTextField unlocksXBox;
    private javax.swing.JLabel unlocksXLabel;
    private javax.swing.JFormattedTextField unlocksYBox;
    private javax.swing.JLabel unlocksYLabel;
    private javax.swing.JFormattedTextField unlocksZBox;
    private javax.swing.JLabel unlocksZLabel;
    private javax.swing.JCheckBox visibleBox;
    // End of variables declaration//GEN-END:variables
}
